package com.pw.study.ctp;

import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class WordServer {
    public static void main(String[] args) {
        try {
            ServerSocket sc = new ServerSocket(9999);
             Socket socket = sc.accept();
            OutputStream outputStream = socket.getOutputStream();
            DataOutputStream out = new DataOutputStream(outputStream);
            while(true){
                out.writeUTF("hello world hello");
                out.flush();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
